/**
 * Copyright (c) 2018-present, Chen Guodong
 * All rights reserved.
 *
 * @flow
 */


<template>
  <div class="input">
    <div class="label">{{data.label}}</div>
    <div class="value">
      <input type="text" v-model="result" :placeholder="data.placeholder">
      <i class="iconfont icon-close-cir default" v-on:click.stop="result = ''" v-show="result"></i>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: Object || Array
  },
  data() {
    return {
      result: this.data.value || '',
      table: this.data.table,
    };
  },
  mounted() {
    this.tables = this.data.table;
  },
  components: {}
};
</script>

<style lang='less' scoped>
@import "../../util/themt.less";

.input {
  background: #fff;
  display: flex;
  padding: 5px 10px;
  font-size: 14px;
  line-height: 26px;
}
.label {
  flex: 1;
  text-align: left;
  color: @font-regular;
  font-weight: 500;
}

.value {
  flex: 1;
  text-align: right;
  position: relative;
  display: flex;
  color: @font-secondary;
  input {
    outline: none;
    width: 100%;
    height: 100%;
    text-align: right;
    flex: 1;
    color: @font-regular;
  }
  i {
    display: inline-block;
    width: 20px;
  }
}

.default {
  color: @font-secondary;
}
</style>
